package com.ruoyi.notice.service.impl;

import com.ruoyi.notice.domain.Message;
import com.ruoyi.notice.mapper.MessageMapper;
import com.ruoyi.notice.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 23118
 * @version 1.0
 * @description: TODO
 * @date 2025/5/12 19:17
 */
@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    private MessageMapper messageMapper;
    /**
     * 新增消息中心
     *
     * @param message 消息中心
     * @return 结果
     */
    @Override
    public int insertMessage(Message message)
    {
        return messageMapper.insertMessage(message);
    }

    @Override
    public void deleteMessageByNoticeId(Long noticeId) {
        messageMapper.deleteMessageByNoticeId(noticeId);
    }

    @Override
    public List<Message> getMessagesByUserId(Long userId) {
        List<Message> messageList = messageMapper.getMessagesByUserId(userId);
        return messageList;
    }

    @Override
    public void deleteMessageByHid(String hid) {
        messageMapper.deleteMessageByHid(hid);
    }

    @Override
    public void updateMessageByHid(Message message) {
        messageMapper.updateMessageByHid(message);
    }

    @Override
    public void deleteRescueMessageByHid(String hid) {
        messageMapper.deleteRescueMessageByHid(hid);
    }


}
